$(function(){
	init();
});


//生成扫描包
function generatePackage(){
	var basePath = $("#basePath").val();
	$.ajax({
		type:"post",
		url:"http://localhost:8082/phr-scan/generate/addFolder",
		success:function(data){
			
			if(data!=null){
				var html="";
				html+="<tr>"+
					  "	<td class='tdLabel_5'>"+(data.createMan==undefined?'':data.createMan)+"</td>"+
					  "	<td class='tdLabel_5'>"+(data.folderName==undefined?'':data.folderName)+"</td>"+
					  "	<td class='tdLabel_5'>"+(data.createTime==undefined?'':data.createTime)+"</td>"+
					  "	<td class='tdLabel_5'>"+(data.status==1?'未使用':'已使用')+"</td>"+
					  "</tr>";
				$("#tbody").append(html);
			}else{
				alert("保存失败!");
			}
		}
	});
}

//查询生成文件集合
function init(){
	var basePath = $("#basePath").val();
	$.ajax({
		type:"post",
		url:"http://localhost:8082/phr-scan/generate/getGeneratorFolderList",
		success:function(data){
			if(data!=null){
				var html="";
				for(var i in data){
					var folder=data[i];
					html+="<tr>"+
					  "	<td class='tdLabel_5'>"+(folder.createMan==undefined?'':folder.createMan)+"</td>"+
					  "	<td class='tdLabel_5'>"+(folder.folderName==undefined?'':folder.folderName)+"</td>"+
					  "	<td class='tdLabel_5'>"+(folder.createTime==undefined?'':folder.createTime)+"</td>"+
					  "	<td class='tdLabel_5'>"+(folder.status==1?'未使用':'已使用')+"</td>"+
					  "</tr>";
				}
				$("#tbody").html(html);
			}
		}
	})
}